<?php
/**
 * Created by PhpStorm.
 * User: chniccs
 * Date: 2019-07-29
 * Time: 10:58
 */

namespace app\miniprogram\model;


use app\model\Base;

class JzCategory extends Base
{
    /**
     * 获取分类的map
     * @return array
     */
    public function getCategoryMap(){
        $list = $this->where(['is_custom'=> 0,'del'=>0])->field('id,icon,name')->select()->toArray();
        $result = [];
        foreach ($list as $k => $val) {
            $result[$val['id']]=$val['name'];
        }
        return $result;
    }

}